package com.mryan.rabbitmq_springboot.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @description：TODO
 * @Author MRyan
 * @Date 2020/11/23 14:09
 * @Version 1.0
 */
@Component
public class WorkCustomer {

    /**
     * 一个消费者
     */
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receive1(String message) {
        System.out.println("Message1= " + message);
    }

    /**
     * 另一个消费者
     */
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receive2(String message) {
        System.out.println("Message2= " + message);
    }

}
